<?php
class deleteErrorRingtoneAction extends sfActions {
	public function execute(){
		$retVal = new stdClass();
		$retVal->success = false;
		if ($this->getRequest()->getMethod() == sfRequest::POST)
		{
			$id = $this->getRequestParameter("id");
			if ($id != null)
			{
				while (1)
				{
					$ringtoneAlert = new RingtoneAlert();
					$ringtoneAlert->setRingtoneId($id);
					$ringtoneAlert = RingtoneAlertPeer::doSelectOne($ringtoneAlert->buildCriteria());
					if ($ringtoneAlert)
					{
						$ringtoneAlert->delete();
						$retVal->success = true;
					}
					else
					{
						$retVal->success = false;
						break;
					}
					echo FastJSON::encode($retVal);
				}
			}
		}
		exit();
	}
}
?>